<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Index</title>
    <link rel="shortcut icon" href="#"/>
    <script src="axios.min.js"></script>
</head>
<body>
<div>
    <form>
        <input type="file" id="file"/>
        <input type="button" value="测试" id="test">
    </form>
</div>
<script>
    document.getElementById("test").onclick = function () {
        let param = new FormData();
        param.append("filePrefix","test");
        param.append("file", document.getElementById("file").files[0]);
        axios.post("/miniapp/api/v1/common/getImgKey", param, {
            headers: {
                "Content-Type": "multipart/form-data"
            }
        }).then(function (res) {
            console.log(res);
        });
    };
</script>
</body>
</html>